﻿using System.Windows;

namespace Central
{
    public partial class OpretPumpstation
    {
        private readonly DataHandler _handler;

        public OpretPumpstation(DataHandler handler)
        {
            _handler = handler;

            InitializeComponent();
        }

        private void ButtonSubmit_Click(object sender, RoutedEventArgs e)
        {
            var name = TextBoxName.Text;
            var host = TextBoxHost.Text.Split(':');

            _handler.CreatePumpStation(name, host[0], int.Parse(host[1]));

            Close();
        }
    }
}
